[data-editor-loading] {
  @include gl-relative;
  @include gl-display-flex;
  @include gl-justify-content-center;
  @include gl-align-items-center;
  @include gl-z-index-0;

  > * {
    filter: blur(5px);
  }

  &::before {
    content: '';
    @include spinner-deprecated(32px, 3px);
    @include gl-absolute;
    @include gl-z-index-1;
  }

  pre {
    opacity: 0;
  }
}

[id^='source-editor-'] {
  height: 500px;
}

.source-editor-preview {
  @include gl-display-flex;

  .md {
    @include gl-overflow-scroll;
    @include gl-px-6;
    @include gl-py-4;
    @include gl-w-full;
  }

  .gl-source-editor {
    @include gl-order-n1;
    border-radius: 0 0 $border-radius-default $border-radius-default;
  }
}

.monaco-editor.gl-source-editor {
  // Fix unreadable headings in tooltips for syntax highlighting themes that don't match general theme
  &.vs-dark .markdown-hover {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: $source-editor-hover-light-text-color;
    }
  }

  &.vs .markdown-hover {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: $source-editor-hover-dark-text-color;
    }
  }

  .margin-view-overlays {
    .line-numbers {
      @include gl-display-flex;
      @include gl-justify-content-end;
      @include gl-relative;

      &::before {
        @include gl-visibility-hidden;
        @include gl-align-self-center;
        @include gl-bg-gray-400;
        @include gl-mr-2;
        @include gl-w-4;
        @include gl-h-4;
        mask-image: asset_url('icons-stacked.svg#link');
        mask-repeat: no-repeat;
        mask-size: cover;
        mask-position: center;
        content: '';
      }

      &:hover {
        @include gl-text-decoration-underline;
        cursor: pointer !important;
      }

      &:hover::before {
        @include gl-visibility-visible;
      }

      &:focus::before {
        @include gl-visibility-visible;
        outline: auto;
      }

      .link-anchor {
        @include gl-display-block;
        @include gl-absolute;
        @include gl-w-full;
        @include gl-h-full;
      }
    }
  }

  // Remove custom focus from element
  .inputarea {
    @include gl-shadow-none;
  }
}

.active-line-text {
  @include gl-bg-orange-600;
  @include gl-opacity-3;
}
